<?php
	/**
 	 * 消息模块Api Controller
 	 *
 	 * 消息模块Api Controller的注意及说明
 	 * 以下use模块请不要互相伤害
  	 *
 	 * @author    xiecz <xiecz@yunys.com.cn>
 	 * @copyright 2016 QuanZhouYunYiShang Inc.
 	 */
	namespace App\Http\Controllers\Api\Message;
	use Illuminate\Routing\Controller as BaseController;
	use Request,Response;
	use App\Services\JPush\JPushService;
	class JPushController extends BaseController{

		public function __construct(JPushService $jpushService){
			$this->jpushService	= $jpushService;
		}
		/**
		 * 显示推送链接页面
		 */
		public function getPushhtmlurl(){
			$input	= Request::all();
			$result	= $this->jpushService->pushHtmlUrl($input);
			return view('api.pushhtml')->with('pushhtml',$result);
		}

		/**
			获取所有消息类别列表
		 */
		function postPushClassList(){
			$input	= Request::all();
			$result	= $this->jpushService->pushClassList($input);
			return response()->json($result);
		}


		/**
		 * 获取用户推送列表
		 * 参数：
		 *		user_id			用户编号
		 */
		function postShowPushList(){
			$input	= Request::all();
			$result	= $this->jpushService->showPushList($input);
			return response()->json($result);
		}

		//删除推送
		function postDeletePush(){
			$input	= Request::all();
			$result	= $this->jpushService->delPush($input);
			return response()->json($result);
		}

		//获取消息未读数
		function postMessageUnRead(){
			$input 	= Request::all();
			$result = $this->jpushService->unReadCount($input);
			return response()->json($result);
		}

		//测试
		function test(){
			$input	= Request::all();
			$result = $this->jpushService->test($input);
			return response()->json($result);
		}

	}
